	var list = document.getElementsByClassName('list');

	var banner = document.getElementsByClassName('banner');

	var dotlist = document.getElementsByClassName('dotlist');

	var turn_left = document.getElementById('turn_left');

	var turn_right = document.getElementById('turn_right');

	//定义初始展现index
	var num =0;

	function run () {

		for (var i = 0; i < list.length; i++) {
			list[i].style.display='none';
			dotlist[i].style.backgroundColor='#8B8B8B';
			
		};

		list[num].style.display='block';
		dotlist[num].style.backgroundColor='#fff';
		

		if(num==list.length-1){
			num=0;
		}else{
			num++;
		}

		
	}


	time = setInterval(run, 800);


	banner[0].onmouseover = function (){
		clearInterval(time);
	}


	banner[0].onmouseout = function (){
		time = setInterval(run, 800);
	}
	for (var k=0;k<dotlist.length; k++) {
		run2(k);
	};
	
	function run2(k) {
		dotlist[k].onclick= function (){
			num=k;
			run();
		}
	};
	turn_left.onclick= function(){
		if (num==0) {
			num=dotlist.length-2
		}else if (num==1) {
			num=dotlist.length-1
		}else{
			num=num-2};
			run()
	}
	turn_right.onclick=function(){
		run()
	}
	
